#!/bin/bash

PATH_NS="/home/lfoliveira/Desktop/ns-allinone-2.34/bin/ns"

echo "########################################################################" > run.log
echo "#   SCRIPT DE SIMULAÇÃO NS                                             #" >> run.log
echo "#   Autor: Luiz Oliveira                                               #" >> run.log
echo "#   Data-Hora da Execucao: `date`                #" >> run.log
echo "#   PATH_NS = $PATH_NS        #" >> run.log
echo "# Passos:                                                              #" >> run.log
echo "#  1) Remover traces anteriores                                        #" >> run.log
echo "#  2) Executar simulação: ns infraCircCBR.tcl                          #" >> run.log
echo "#  3) Executar o pre-leitor (alterações das linhas do trace)           #" >> run.log
echo "#  4) Executar o analisador do trace                                   #" >> run.log
echo "#                                                                      #" >> run.log

echo "#  Passo 1 ...                                                         #" >> run.log

rm *.tr

echo "#  Passo 2 ...                                                         #" >> run.log

/home/lfoliveira/Desktop/ns-allinone-2.34/bin/ns infraCircCBR.tcl >> run.log 2>> run.log

echo "#  Passo 3 ...                                                         #" >> run.log

php preReader.php >> run.log 2>> run.log

echo "#  Passo 4 ...                                                         #" >> run.log

php reader.php >> run.log 2>> run.log

echo "#  Fim.                                                                #">> run.log
